package com.itheima.dao;

import com.itheima.pojo.Tag;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface BlogTagDao extends Mapper<Tag> {
    @Select("SELECT tag_uid, COUNT(tag_uid) as referCount FROM  t_blog where status=1  GROUP BY tag_uid")
    List<Map<String, Object>> selectSortByCite();

    @Select("SELECT uid,content,status,click_count,create_time,update_time,sort FROM t_tag  WHERE  status = 1 order by click_count DESC")
    List<Tag> selectSortByClickCount();
}
